<!--
 * @Author: Nice-2-CU 81088875+Nice-2-CU@users.noreply.github.com
 * @Date: 2023-07-11 21:32:36
 * @LastEditors: Nice-2-CU 81088875+Nice-2-CU@users.noreply.github.com
 * @LastEditTime: 2023-07-19 11:57:19
 * @FilePath: \lost-found-web\src\views\home\message\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <ReplyComment :comment="item" v-for="item in messages"></ReplyComment>
    <el-empty description="这里什么也没有（；´д｀）ゞ" v-show="!messages.length"></el-empty>
  </div>
</template>

<script>
import Cookies from "js-cookie";
import ReplyComment from "@/components/message/ReplyComment.vue";
import { replyByUserId } from "@/api/post/comment";

export default {
  components: { ReplyComment },
  data() {
    return {
      userId: 0,
      messages: []
    }
  },
  methods: {
    getMessageList() {
      replyByUserId({
        userId: this.userId
      }).then(res => {
        if(res.data.code === 200) {
          this.messages = res.data.replyCommentVOList
        } else {
          // this.$message.error(res.data.message)
        }
      })
    }
  },
  created() {
    this.userId = JSON.parse(Cookies.get("user")).id
    this.getMessageList()
  }
}
</script>

<style scoped>

</style>
